package org.sith.taskrunner.gwt.client.event;

import com.google.gwt.event.shared.GwtEvent;


public class DataLoadEvent extends GwtEvent<DataLoadEventHandler> {
    public static final Type<DataLoadEventHandler> TYPE = new Type<DataLoadEventHandler>();

    private String message;
    private boolean successfully;
    private boolean hasNext;

    public DataLoadEvent(String message, boolean successfully, boolean hasNext) {
        this.message = message;
        this.successfully = successfully;
        this.hasNext = hasNext;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccessfully() {
        return successfully;
    }

    public void setSuccessfully(boolean successfully) {
        this.successfully = successfully;
    }

    @Override
    public Type<DataLoadEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(DataLoadEventHandler handlerLoad) {
        handlerLoad.onDataLoaded(this);
    }


    public boolean isHasNext() {
        return hasNext;
    }
}
